package com.qijia.common.domain;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

/**
 * AbstractCommonRoleResource entity provides the base persistence definition of
 * the CommonRoleResource entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractCommonRoleResource  extends BaseData implements
		java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6569630810753169279L;
	// Fields

	private Integer CRrId;
	private Resource resource;
	private Role role;

	// Constructors

	/** default constructor */
	public AbstractCommonRoleResource() {
	}

	/** full constructor */
	public AbstractCommonRoleResource(Resource resource,
			Role role) {
		this.resource = resource;
		this.role = role;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "c_rr_id", unique = true, nullable = false)
	public Integer getCRrId() {
		return this.CRrId;
	}

	public void setCRrId(Integer CRrId) {
		this.CRrId = CRrId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "c_rr_resource_id")
	public Resource getResource() {
		return this.resource;
	}

	public void setResource(Resource resource) {
		this.resource = resource;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "c_rr_role_id")
	public Role getRole() {
		return this.role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

}